﻿using System;
using System.ComponentModel.DataAnnotations;
using LERP.Domain;
using LERP.Domain.Enums;

namespace LERP.Web.Controllers.ViewModels.OrderViewModels
{
    public class CreateOrderViveModel
    { 

        public virtual string OrderItems { get; set; } 
        /// <summary>
        /// 客户编号 关联合同管理
        /// </summary> 
        [Display(Name = "客户")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int CustomerId { get; set; } 
        /// <summary>
        /// 客户名称
        /// </summary> 
        [Display(Name = "客户")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual string Customer { get; set; }


        /// <summary>
        /// 合同
        /// </summary> 
        [Display(Name = "合同")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int Contract { get; set; }

        /// <summary>
        /// 合同
        /// </summary> 
        [Display(Name = "合同")] 
        public virtual string ContractName { get; set; }
        /// <summary>
        /// 订单状态  草稿  待发货  待接收  等待回单  关闭
        /// </summary> 
        [Display(Name = "订单状态")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int Status { get; set; }
        /// <summary>
        /// 客户订单号
        /// </summary> 
        [Display(Name = "客户订单号")] 
        [StringLength(255, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string CustomerOrderNo { get; set; }
        /// <summary>
        /// 下单日期
        /// </summary> 
        [Display(Name = "下单日期")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual string OrderDate { get; set; }
        /// <summary>
        ////验收回单否 是或否
        /// </summary>  
        [Display(Name = "已验收")] 
        public virtual bool Confirmation { get; set; }
        /// <summary>
        /// 客户要求交货时间
        /// </summary> 
        [Display(Name = "客户要求交货日期")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual string ExpectDelivery { get; set; } 
        /// <summary>
        /// 实际交货时间
        /// </summary>  
        [Display(Name = "实际交货日期")]
        public virtual string TangibleDelivery { get; set; }
        /// <summary>
        /// 商家宝销售 没弄清楚，暂时预留此字段
        /// </summary>  
        [Display(Name = "销售单号")]
        [StringLength(255, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string SafeNo { get; set; } 
        /// <summary>
        /// 配送单号
        /// </summary>  
        [Display(Name = "配送单号")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string DeliveryNo { get; set; }

        /// <summary>
        ///关联物流公司 
        /// </summary>  
        [Display(Name = "物流公司")] 
        public virtual int? LogisticsProvider { get; set; }

        /// <summary>
        ///承运单号码
        /// </summary>  
        [Display(Name = "承运单号")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string CarrierCode { get; set; }

        /// <summary>
        ///租借出仓单
        /// </summary>   
        [Display(Name = "租借出仓单号")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string WarehouseCode { get; set; }

        /// <summary>
        /// 不关联货品
        /// </summary>
        [Display(Name = "是")]
        public virtual bool IsGoods { get; set; }

        /// <summary>
        /// 发货金额
        /// </summary>  
        [Display(Name = "发货金额")]
        [Required(ErrorMessage = "{0}不能为空")]
        [RegularExpression("^[1-9]\\d*[\\.]?\\d*|0\\.\\d*[1-9]\\d*$", ErrorMessage = "{0}必须大于0")] 
        public virtual decimal Amount { get; set; }


        /// <summary>
        ///备注
        /// </summary>  
        [Display(Name = "备注")]
        [StringLength(500, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Remark { get; set; }
         
    }
}